<?php
namespace addons\TfFutures\api\controllers;

use addons\TfFutures\common\models\Adv;
use common\helpers\ResultDataHelper;
use Yii;
use api\controllers\OnAuthController;



class AdvController extends OnAuthController
{
    public $modelClass = Adv::class;

    protected $optional = ['index'];

    //查询
    public function actionIndex(){
        if(Yii::$app->request->isGet){
            $bvex = Adv::find()
                ->where(['status'=>1])
                ->orderBy('sort desc')
                ->all();
            return ResultDataHelper::api(200, ['success'], $bvex);
        }else{
            return ResultDataHelper::api(304,'请求的方法有误');
        }
    }
}